
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package be.ac.ua.comp.projectGPT.BiddingPolicies;

//~--- non-JDK imports --------------------------------------------------------

import be.ac.ua.comp.projectGPT.auctioneers.Auctioneer;
import be.ac.ua.comp.projectGPT.auctions.Auction;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Abstraction for a bidding policy.
 */
public abstract class BiddingPolicy {
    final Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());
    Auction      auction;
    Auctioneer   auctioneer;

    public BiddingPolicy() {
        logger.info("Creating");
    }

    public void setAuction(Auction auction) {
        logger.info("Setting auction");

        this.auction = auction;
    }

    public void setAuctioneer(Auctioneer auctioneer) {
        this.auctioneer = auctioneer;
    }

    /**
     * Denotes whether a certain bid should be accepted according to the policy.
     *
     * @param bid The bid to be checked.
     * @return True/False depending on whether the bid was accepted.
     */
    public abstract boolean accept(long bid,long previous);

    public abstract long getSuggestion(long previousBid);
}
